home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / db / esm-3.1 / esm-3 / usr / local / sm / src / common / lm / space.c < prev   
Encoding:
C/C++ Source or Header  |  1996-05-05  |  3.6 KB  |  117 lines

  1. /*
  2.  *   $RCSfile: space.c,v $  
  3.  *   $Revision: 1.1.1.1 $  
  4.  *   $Date: 1996/05/04 21:55:11 $      
  5.  */ 
  6. /**********************************************************************
  7. * EXODUS Database Toolkit Software
  8. * Copyright (c) 1991 Computer Sciences Department, University of
  9. *                    Wisconsin -- Madison
  10. * All Rights Reserved.
  11. *
  12. * Permission to use, copy, modify and distribute this software and its
  13. * documentation is hereby granted, provided that both the copyright
  14. * notice and this permission notice appear in all copies of the
  15. * software, derivative works or modified versions, and any portions
  16. * thereof, and that both notices appear in supporting documentation.
  17. *
  18. * THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY OF WISCONSIN --
  19. * MADISON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.  
  20. * THE DEPARTMENT DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
  21. * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  22. *
  23. * The EXODUS Project Group requests users of this software to return 
  24. * any improvements or extensions that they make to:
  25. *
  26. *   EXODUS Project Group 
  27. *     c/o David J. DeWitt and Michael J. Carey
  28. *   Computer Sciences Department
  29. *   University of Wisconsin -- Madison
  30. *   Madison, WI 53706
  31. *
  32. *     or exodus@cs.wisc.edu
  33. *
  34. * In addition, the EXODUS Project Group requests that users grant the 
  35. * Computer Sciences Department rights to redistribute these changes.
  36. **********************************************************************/
  37.  
  38. #include "sysdefs.h"
  39. #include "ess.h"
  40. #include "checking.h"
  41. #include "error.h"
  42. #include "io.h"
  43. #include "lock.h"
  44. #include "lock_globals.h"
  45.  
  46.  
  47. /*
  48.  *    define the lock compatibility table of locks held 
  49.  *    by other transactions
  50.  */
  51. UONE    LM_Compat[NUM_LOCK_MODES][NUM_LOCK_MODES] = {
  52.  
  53.             /* NL     IS     IX     SH     SIX    EX    */
  54.  
  55. /* NL  */    { TRUE,  TRUE,  TRUE,  TRUE,  TRUE,  TRUE  },
  56. /* IS  */    { TRUE,  TRUE,  TRUE,  TRUE,  TRUE,  FALSE },
  57. /* IX  */    { TRUE,  TRUE,  TRUE,  FALSE, FALSE, FALSE },
  58. /* SH  */    { TRUE,  TRUE,  FALSE, TRUE,  FALSE, FALSE },
  59. /* SIX */    { TRUE,  TRUE,  FALSE, FALSE, FALSE, FALSE },
  60. /* EX  */    { TRUE,  FALSE, FALSE, FALSE, FALSE, FALSE } };
  61.  
  62.  
  63. /*
  64.  *    define the lock compatibility table of locks held 
  65.  *    by the transaction requestion the lock 
  66.  */
  67. UONE    LM_Compat_Upgrade[NUM_LOCK_MODES][NUM_LOCK_MODES] = {
  68.  
  69.             /* NL     IS     IX     SH     SIX    EX    */
  70.  
  71. /* NL  */    { TRUE,  TRUE,  TRUE,  TRUE,  TRUE,  TRUE  },
  72. /* IS  */    { FALSE, TRUE,  TRUE,  TRUE,  TRUE,  TRUE  },
  73. /* IX  */    { FALSE, FALSE, TRUE,  FALSE, TRUE,  TRUE  },
  74. /* SH  */    { FALSE, FALSE, FALSE, TRUE,  TRUE,  TRUE  },
  75. /* SIX */    { FALSE, FALSE, FALSE, FALSE, TRUE,  TRUE  },
  76. /* EX  */    { FALSE, FALSE, FALSE, FALSE, FALSE, TRUE  } };
  77.  
  78.  
  79. /*
  80.  *    define the lock conversion table
  81.  */
  82. UONE    LM_Convert[NUM_LOCK_MODES][NUM_LOCK_MODES] = {
  83.  
  84.             /* NL  IS   IX   SH   SIX   EX    */
  85.  
  86. /* NL  */    { NL,  IS,  IX,  SH,  SIX,  EX },
  87. /* IS  */    { IS,  IS,  IX,  SH,  SIX,  EX },
  88. /* IX  */    { IX,  IX,  IX,  SIX, SIX,  EX },
  89. /* SH  */    { SH,  SH,  SIX, SH,  SIX,  EX },
  90. /* SIX */    { SIX, SIX, SIX, SIX, SIX,  EX },
  91. /* EX  */    { EX,  EX,  EX,  EX,  EX,   EX } };
  92.  
  93.  
  94. /*
  95.  *    define the lock supremum table
  96.  */
  97. UONE    LM_Supremum[NUM_LOCK_MODES][NUM_LOCK_MODES] = {
  98.  
  99.             /* NL  IS   IX   SH   SIX   EX    */
  100.  
  101. /* NL  */    { NL,  IS,  IX,  SH,  SIX,  EX },
  102. /* IS  */    { IS,  IS,  IX,  SH,  SIX,  EX },
  103. /* IX  */    { IX,  IX,  IX,  SIX, SIX,  EX },
  104. /* SH  */    { SH,  SH,  SIX, SH,  SIX,  EX },
  105. /* SIX */    { SIX, SIX, SIX, SIX, SIX,  EX },
  106. /* EX  */    { EX,  EX,  EX,  EX,  EX,   EX } };
  107.  
  108.  
  109. /*
  110.  *    define a table for printing lock modes
  111.  */
  112. char    *LM_Character[NUM_LOCK_MODES] = {
  113.  
  114.             "NL", "IS", "IX", "SH", "SIX", "EX"
  115.  
  116.         };
  117.